package edu.guet.server.mapper;

import edu.guet.server.model.Question;
import edu.guet.server.model.dto.Survey;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface PaperMapper {

    @Select("SELECT * FROM survey where paper_id=#{paperId}")
    Survey selectPaper(Integer paperId);

    List<Question> selectQSelectList(Integer paperId);

    Integer getQsCount(Integer testId);

    Integer getPaperId(Integer testId);

    void updatePerMaxScore(Integer paperId, Double qsScore);

    @Insert("INSERT into test_paper (test_id, paper_id) VALUES (#{newUnitTestId},#{paperId})")
    void addTestPaper(Integer newUnitTestId, Integer paperId);

    Double getMaxScorePer(Integer paperId);

    String getQuesRight(Integer qsId);
}
